#include<bits/stdc++.h>
using namespace std;
#define int long long
const int maxn=2e5+10;
int n,mx,a[maxn],r[maxn],ans,leav;
signed main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        cin>>r[i];
        a[r[i]]++;
        mx=max(mx,r[i]);
    }
    for(int i=mx;i>=1;i--)
        if(a[i]>0)
        {
            if(leav<a[i])
            {
                ans+=a[i];
                ans-=leav;
                leav=0;
            }
            else
                leav-=a[i];
            leav+=a[i];
        }
    cout<<ans<<endl;
    return 0;
}
